// 1. 定义（路由）组件。
// 可以从其他文件 import 进来

//// 首页
const homepage = resolve => require(['./views/homepage/homepage'], resolve)
//// 登录
const login = resolve => require(['./views/login/login'], resolve)

//// 注册
const reg = resolve => require(['./views/reg/reg'], resolve)
//// 找回密码
const findpassword = resolve => require(['./views/findpassword/findpassword'], resolve)

//// 快速交易
const trading = resolve => require(['./views/trading/trading'], resolve)
// 买卖交易
const trade = resolve => require(['./views/trading/trade'], resolve)
// 行情交易
const market = resolve => require(['./views/trading/market'], resolve)
// 委托交易
const consignation = resolve => require(['./views/trading/consignation'], resolve)

//// 个人中心
const user = resolve => require(['./views/user/user'], resolve)
// 安全设置
const settings = resolve => require(['./views/user/settings/settings'], resolve)
// 安全记录
const securitylog = resolve => require(['./views/user/securitylog'], resolve)
// 安全策略
const policy = resolve => require(['./views/user/policy'], resolve)
// 实名认证
const auth = resolve => require(['./views/user/auth'], resolve)
// 我的消息
const notice = resolve => require(['./views/user/notice'], resolve)
// 基本信息
const info = resolve => require(['./views/user/info'], resolve)
//我的API
const api=resolve => require(['./views/user/api'],resolve)

//// 资产理财
const money = resolve => require(['./views/money/money'], resolve)
// 资产总览
const overview = resolve => require(['./views/money/overview'], resolve)
// 资产可视化
const visualization = resolve => require(['./views/money/visualization'], resolve)
// 充值
const recharge = resolve => require(['./views/money/recharge'], resolve)
// 提现
const cashIn = resolve => require(['./views/money/cashIn'], resolve)
//	 币宝
const bbao = resolve => require(['./views/money/bbao'], resolve)
//	 合伙人
const partner = resolve => require(['./views/money/partner'], resolve)

const capital = resolve => require(['./views/capital/capital'], resolve)
//const market = resolve => require(['./views/market/market'], resolve)
const personal = resolve => require(['./views/personal/personal'], resolve)
//const login = resolve => require(['./views/capital/login'], resolve)

// 2. 定义路由
// 每个路由应该映射一个组件。 其中"component" 可以是
// 通过 Vue.extend() 创建的组件构造器，
// 或者，只是一个组件配置对象。
// 我们晚点再讨论嵌套路由。
const routers = [{
	path: '/',
	component: homepage
},{
	path: '/capital',
	component: capital
	
}, {
	path: '/login',
	component: login
}, {
	path: '/user',
	component: user,
	children: [{
		path: '/user/settings',
		component: settings
	}, {
		path: '/user/securitylog',
		component: securitylog
	}, {
		path: '/user/policy',
		component: policy
	}, {
		path: '/user/auth',
		component: auth
	}, {
		path: '/user/notice',
		component: notice
	}, {
		path: '/user/info',
		component: info
	},{
		path:'/user/api',
		component:api
	}]
}, {
	path: '/reg/:type/:step',
	component: reg
}, {
	path: '/findpassword/:type',
	component: findpassword
}, {
	path: '/trading',
	component: trading,
	children: [{
		path: '/trading/:type/trade',
		component: trade
	}, {
		path: '/trading/:type/market',
		component: market
	}, {
		path: '/trading/:type/consignation',
		component: consignation
	}]
}, {
	path: '/money/money',
	component: money,
	children: [{
		path: '/money/overview',
		component: overview
	}, {
		path: '/money/visualization',
		component: visualization
	}, {
		path: '/money/recharge',
		component: recharge
	}, {
		path: '/money/cashIn',
		component: cashIn
	}, {
		path: '/money/bbao',
		component: bbao
	}, {
		path: '/money/partner',
		component: partner
	}, {
		path: '*',
		component: homepage
	}]
}]

export default routers;